package com.controller;

import com.domain.User;
import com.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * Created by Administrator on 2017/5/22.
 */
@RestController
public class Controller {
    @Autowired
    UserService userService;

    @RequestMapping("/find")
   public User find(int id ){
         User user=userService.find(id);

        return user;
    }
    @RequestMapping("/add")
   public  void add(User user){

       userService.add(user);

    }

}
